<template>
    <div class="home-panel">
        <div class="container">
            <!-- 主标题  副标题-->
            <div class="head">
                <h3 class="title">{{ title }}<small>{{ subtitle }}</small></h3>
                <!-- <RouterLink to="/"><span>查看全部</span></RouterLink> -->
            </div>
            <!--商品列表-->
            <ul class="goodsList">
                <li v-for="item in list" :key="item.id">
                    <RouterLink to="/">
                        <img :src="item.picture" alt="">
                        <p class="title ellipsis">{{ item.title }}</p>
                        <p class="desc">{{ item.alt }}</p>
                    </RouterLink>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
export default {
    props:{
        title: {
            type: String,
            default: ''
        },
        subtitle: {
            type: String,
            default: ''
        },
        list:{
            type:Array,
            default:()=>[]
        }
    }
}
</script>

<style lang="scss" scoped>
.home-panel {
    background: #ffff;
    position: relative;
    .head {
        padding: 40px 0;
        display: flex;
        align-items: flex-end;

        h3 {
            flex: 1;
            font-size: 32px;
            font-weight: 400;
            margin-left: 6px;
            height: 35px;
            line-height: 35px;
            

            small {
                font-size: 16px;
                color: #999;
                margin-left: 20px;
            }
        }
    }

}

.home-panel {
    position: relative;

    .goodsList {
        position: relative;
        height: 426px;
        display: flex;
        justify-content: space-between;

        li {
            width: 306px;
            height: 406px;
            background: #fff;
            transition: all .5s;
            text-align: -webkit-match-parent;

            a {
                color: #333;
                outline: none;

                img {
                    width: 306px;
                    height: 306px;
                }

                .ellipsis,
                .ellipsis-2 {
                    text-overflow: ellipsis;
                    overflow: hidden;
                }

                .ellipsis {
                    white-space: nowrap;
                }

                p {
                    font-size: 22px;
                    padding: 12px 30px 0 30px;
                    text-align: center;
                }

                .desc {
                    color: #999;
                    font-size: 18px;
                }
            }
        }

        li:hover {
            transform: translate3d(0, -3px, 0);
            box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
        }
    }
}

</style>